find_package(PkgConfig)
pkg_check_modules(PC_QRENCODE  qrencode)

find_path(QRENCODE_INCLUDE_DIRS
    NAMES qrencode.h
    HINTS ${PC_QRENCODE_INCLUDEDIR}
    ${PC_QRENCODE_INCLUDE_DIRS}
)

find_library(QRENCODE_LIBRARIES
    NAMES qrencode
    HINTS ${PC_QRENCODE_LIBDIR}
    ${PC_QRENCODE_LIBRARY_DIRS}
)

#message("QRENCODE_LIBRARIES=${QRENCODE_LIBRARIES} QRENCODE_INCLUDE_DIRS=${QRENCODE_INCLUDE_DIRS} PC_QRENCODE_VERSION=${PC_QRENCODE_VERSION}")
if(QRENCODE_INCLUDE_DIRS AND QRENCODE_LIBRARIES)
    set(QRENCODE_FOUND TRUE)
    set(QRENCODE_LIBRARY ${QRENCODE_LIBRARIES})
    set(QRENCODE_INCLUDE_DIR ${QRENCODE_INCLUDE_DIRS})
    set(QRENCODE_VERSION ${PC_QRENCODE_VERSION})
endif()

include(FindPackageHandleStandardArgs)
#FIND_PACKAGE_HANDLE_STANDARD_ARGS(Fribidi REQUIRED_VARS QRENCODE_INCLUDE_DIRS QRENCODE_LIBRARIES 
#	FOUND_VAR QRENCODE_FOUND VERSION_VAR QRENCODE_VERSION)

mark_as_advanced(QRENCODE_LIBRARIES QRENCODE_LIBRARY QRENCODE_INCLUDE_DIRS QRENCODE_INCLUDE_DIR QRENCODE_FOUND)

